import java.awt.*;
import java.awt.event.*;
/**
 * La clase MemoryMode estalece componentes que permiten al 
 * operador acceder a un programa de pieza almacenado en la
 * máquina y ejecutarlo.
 */
public class MemoryMode extends Mode
{
    public MemoryMode()
    {
        super(
            "memoryMode", 
            KbdCmdId.CmdValue.MODE_MEMORY
        );
    }
    public void setDescriptionViewPanel()
    {
        addTopPanels(
            "currentPosition",
            Mode.Place.WEST,
            new GridBagConstraints(
                0,
                0,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.AXIS_CURRENT_POSITION
            },
            null
        );
        addTopPanels(
            "cut",
            Mode.Place.SOUTH,
            new GridBagConstraints(
                0,
                0,
                1,
                1,
                1,
                0,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.MOTION_TYPE,
                Data.Id.CARTESIAN_PLANE,
                Data.Id.DIMENSIONING_MODE,
                Data.Id.CUTTING_MODE,
                Data.Id.SPINDLE_DIRECTION,
                Data.Id.SPINDLE_MOTION
            },
            null
        );
        addTopPanels(
            "targetPosition",
            Mode.Place.EAST,
            new GridBagConstraints(
                0,
                1,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.ATP
            },
            null
        );
        addTopPanels(
            "programZero",
            Mode.Place.EAST,
            new GridBagConstraints(
                0,
                0,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.PROGRAM_ZERO
            },
            null
        );
        addTopPanels(
            "spindle",
            Mode.Place.WEST,
            new GridBagConstraints(
                0,
                1,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.SPINDLE
            },
            null
        );
        addTopPanels(
            "feedrate",
            Mode.Place.WEST,
            new GridBagConstraints(
                0,
                2,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.FEEDRATE
            },
            null
        );
        addTopPanels(
            "state",
            Mode.Place.SOUTH,
            new GridBagConstraints(
                2,
                0,
                1,
                1,
                1,
                0,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.AXIS_LIMIT_SWITCH
            },
            null
        );
        addTopPanels(
            "tool",
            Mode.Place.SOUTH,
            new GridBagConstraints(
                1,
                0,
                1,
                1,
                1,
                0,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.TOOL_MAGAZINE_CAPACITY,
                Data.Id.MAXIMUM_TOOL_INDEX,
                Data.Id.TOOL_SELECTION_TYPE,
                Data.Id.SELECTED_TOOL_INDEX,
                Data.Id.NEXT_TOOL_INDEX
            },
            null
        );
        addTopPanels(
            "devices",
            Mode.Place.SOUTH,
            new GridBagConstraints(
                3,
                0,
                1,
                1,
                1,
                0,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.DEVICES
            },
            null
        );
        addTopPanels(
            "operationMode",
            Mode.Place.NORTH,
            new GridBagConstraints(
                0,
                0,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.OPERATION_MODE
            },
            null
        );
        addTopPanels(
            "emergencyStop",
            Mode.Place.NORTH,
            new GridBagConstraints(
                1,
                0,
                1,
                1,
                0,
                0,
                GridBagConstraints.EAST,
                GridBagConstraints.NONE,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.EMERGENCY_STOP
            },
            null
        );
        addTopPanels(
            "programExecutionArea",
            Mode.Place.CENTER,
            new GridBagConstraints(
                0,
                0,
                1,
                1,
                1,
                1,
                GridBagConstraints.CENTER,
                GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0),
                0,
                0
            ),
            new Data.Id[] {
                Data.Id.OTHER
            },
            new AnotherComponent[] {
                AnotherComponent.PROGRAM_EXECUTION_AREA
            }
        );
    }
    public void setDescriptionEditablePanel()
    {
        addBottomPanels(
            "axisMotion",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.CUTTING_FEEDRATE_OVERRIDE,
                Data.Id.RAPID_TRAVERSE_RATE_OVERRIDE,
                Data.Id.OTHER,
                Data.Id.OTHER
            },
            new AnotherComponent[] {
                AnotherComponent.PANEL,
                AnotherComponent.PANEL
            },
            new GridLayout(2,2)
        );
        addBottomPanels(
            "programExecution",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.MACHINING_CYCLE_STATUS,
                Data.Id.BLOCK_EXECUTION,
                Data.Id.OPTIONAL_STOP,
                Data.Id.BLOCK_SKIP,
                Data.Id.DRY_RUN,
                Data.Id.MST_LOCK,
                Data.Id.XY_AXES_LOCK,
                Data.Id.Z_AXIS_NEGLECT
            },
            null,
            new GridLayout(4,2)
        );
        addBottomPanels(
            "spindle",
            Mode.Place.CENTER,
            new Data.Id[] {
                Data.Id.SPINDLE_SPEED_OVERRIDE
            },
            null,
            null//new FlowLayout(FlowLayout.CENTER,16,16)
        );
    }
}
